
///////////////////////////////////////////////////////////////////////////
//
// This Star Micronics Java ADK was made with the NetBeans IDE.
// You can download the IDE for free at http://netbeans.org/downloads/
//
// If you wish to compile this without NetBeans, you can install Apache ANT and use the build.xml file
//
// We highly recommend using the NetBeans IDE instead of a NO IDE approach
//
//////////////////////////////////////////////////////////////////////////

package com.pescamillam.kiosco.printer;

import com.starmicronics.stario.*;
import java.io.UnsupportedEncodingException;
import java.util.*;
import java.awt.Color;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import javax.swing.ImageIcon;
import javax.swing.text.BadLocationException;
import javax.swing.text.rtf.RTFEditorKit;


/**
 * Star Micronics StarIO Line Mode Java ADK
 * @author Joshua Copeland
 */

public class TestStarIO extends javax.swing.JFrame {

    /**
	 * 
	 */
	private static final long serialVersionUID = 7706417471273395222L;
	static final int TIMEOUT = 1000;
    RTFEditorKit rtf = new RTFEditorKit();

    /** Creates new form Main */
    public TestStarIO() {
        initComponents();

        helpBox.setEditorKit(rtf);
        helpBox.setBackground(Color.white);
        try {
          FileInputStream fi = new FileInputStream("documentation/help_port.rtf");
          rtf.read(fi, helpBox.getDocument(), 0);
        } catch (FileNotFoundException e) {
          System.out.println("Documentation files not found!"+e.toString());
        } catch (IOException e) {
          System.out.println("I/O error"+e.toString());
        } catch (BadLocationException e) {
          System.out.println("Documentation location is bad!"+e.toString());
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        logRadioGrp = new javax.swing.ButtonGroup();
        grpcode39 = new javax.swing.ButtonGroup();
        grpcode93 = new javax.swing.ButtonGroup();
        grpi25 = new javax.swing.ButtonGroup();
        grpcode128 = new javax.swing.ButtonGroup();
        grppdf417 = new javax.swing.ButtonGroup();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        starLogo = new javax.swing.JLabel();
        txtPortName = new javax.swing.JTextField();
        txtPortSettings = new javax.swing.JTextField();
        btnPrintSampleR = new javax.swing.JButton();
        btnOpenCashD = new javax.swing.JButton();
        btnMonitoring = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        jSeparator4 = new javax.swing.JSeparator();
        btnCheckBlock = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        txtStatus = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel9 = new javax.swing.JPanel();
        btnCode39 = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        txtcode39data = new javax.swing.JTextField();
        numcode39 = new javax.swing.JSpinner();
        jPanel13 = new javax.swing.JPanel();
        rb1code39 = new javax.swing.JRadioButton();
        rb2code39 = new javax.swing.JRadioButton();
        rb3code39 = new javax.swing.JRadioButton();
        rb6code39 = new javax.swing.JRadioButton();
        rb5code39 = new javax.swing.JRadioButton();
        rb4code39 = new javax.swing.JRadioButton();
        rb9code39 = new javax.swing.JRadioButton();
        rb8code39 = new javax.swing.JRadioButton();
        rb7code39 = new javax.swing.JRadioButton();
        code39 = new javax.swing.JLabel();
        jPanel10 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        txti2of5data = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        numi2of5 = new javax.swing.JSpinner();
        jPanel14 = new javax.swing.JPanel();
        rb1i2of5 = new javax.swing.JRadioButton();
        rb2i2of5 = new javax.swing.JRadioButton();
        rb3i2of5 = new javax.swing.JRadioButton();
        rb6i2of5 = new javax.swing.JRadioButton();
        rb5i2of5 = new javax.swing.JRadioButton();
        rb4i2of5 = new javax.swing.JRadioButton();
        rb9i2of5 = new javax.swing.JRadioButton();
        rb8i2of5 = new javax.swing.JRadioButton();
        rb7i2of5 = new javax.swing.JRadioButton();
        btni2of5 = new javax.swing.JButton();
        i2of5 = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        btncode93 = new javax.swing.JButton();
        jPanel15 = new javax.swing.JPanel();
        rb1code93 = new javax.swing.JRadioButton();
        rb2code93 = new javax.swing.JRadioButton();
        rb3code93 = new javax.swing.JRadioButton();
        txtcode93 = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        numcode93 = new javax.swing.JSpinner();
        code93 = new javax.swing.JLabel();
        jPanel12 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        txtcode128 = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        numcode128 = new javax.swing.JSpinner();
        jPanel16 = new javax.swing.JPanel();
        rb1code128 = new javax.swing.JRadioButton();
        rb2code128 = new javax.swing.JRadioButton();
        rb3code128 = new javax.swing.JRadioButton();
        btncode128 = new javax.swing.JButton();
        jLabel21 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        cb1DBarcodeOption = new javax.swing.JComboBox();
        code128 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jTabbedPane3 = new javax.swing.JTabbedPane();
        jPanel17 = new javax.swing.JPanel();
        jPanel19 = new javax.swing.JPanel();
        txtQRdata = new javax.swing.JTextField();
        jPanel21 = new javax.swing.JPanel();
        cbQRmodel = new javax.swing.JComboBox();
        jPanel22 = new javax.swing.JPanel();
        numQRcellsize = new javax.swing.JSpinner();
        jPanel23 = new javax.swing.JPanel();
        cbQRecc = new javax.swing.JComboBox();
        jLabel15 = new javax.swing.JLabel();
        btnQRmodel = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();
        btnQRecc = new javax.swing.JButton();
        jLabel17 = new javax.swing.JLabel();
        btnQRcellsize = new javax.swing.JButton();
        jLabel18 = new javax.swing.JLabel();
        btnQRdata = new javax.swing.JButton();
        jLabel19 = new javax.swing.JLabel();
        btnQRprint = new javax.swing.JButton();
        jLabel20 = new javax.swing.JLabel();
        btnQRall = new javax.swing.JButton();
        qrcodes = new javax.swing.JLabel();
        jPanel18 = new javax.swing.JPanel();
        jPanel24 = new javax.swing.JPanel();
        txtPDFdata = new javax.swing.JTextField();
        btnPDFdata = new javax.swing.JButton();
        jPanel25 = new javax.swing.JPanel();
        rbPDF1 = new javax.swing.JRadioButton();
        rbPDF2 = new javax.swing.JRadioButton();
        lblPDFw = new javax.swing.JLabel();
        lblPDFh = new javax.swing.JLabel();
        numPDFw = new javax.swing.JSpinner();
        numPDFh = new javax.swing.JSpinner();
        btnPDFsize = new javax.swing.JButton();
        jPanel26 = new javax.swing.JPanel();
        numPDFratio = new javax.swing.JSpinner();
        btnPDFratio = new javax.swing.JButton();
        jPanel27 = new javax.swing.JPanel();
        numPDFxdim = new javax.swing.JSpinner();
        btnPDFxdim = new javax.swing.JButton();
        jPanel28 = new javax.swing.JPanel();
        numPDFecc = new javax.swing.JSpinner();
        btnPDFecc = new javax.swing.JButton();
        btnPDFall = new javax.swing.JButton();
        lblPDFh1 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        cbCodePage = new javax.swing.JComboBox();
        txtCodePage = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        btnCodePage = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        btnFontA = new javax.swing.JButton();
        btnFontB = new javax.swing.JButton();
        brnFontOCR = new javax.swing.JButton();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        btnLF = new javax.swing.JButton();
        btnLF4mm = new javax.swing.JButton();
        btnLF3mm = new javax.swing.JButton();
        btnMLF = new javax.swing.JButton();
        btnLS3mm = new javax.swing.JButton();
        btnL4mm = new javax.swing.JButton();
        btnL8mm = new javax.swing.JButton();
        btnFF = new javax.swing.JButton();
        numMLF = new javax.swing.JSpinner();
        numL4mm = new javax.swing.JSpinner();
        numL8mm = new javax.swing.JSpinner();
        jPanel7 = new javax.swing.JPanel();
        btnFullCut = new javax.swing.JButton();
        btnFeedFullCut = new javax.swing.JButton();
        btnPartialCut = new javax.swing.JButton();
        btnFeedPartialCut = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jPanel20 = new javax.swing.JPanel();
        chkTFslashz = new javax.swing.JCheckBox();
        chkTFbold = new javax.swing.JCheckBox();
        chkTFunderline = new javax.swing.JCheckBox();
        chkTFupperline = new javax.swing.JCheckBox();
        chkTFinvert = new javax.swing.JCheckBox();
        chkTFupsidedown = new javax.swing.JCheckBox();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        numTFh = new javax.swing.JSpinner();
        numTFw = new javax.swing.JSpinner();
        btnPrintTF = new javax.swing.JButton();
        jPanel29 = new javax.swing.JPanel();
        numTFLM = new javax.swing.JSpinner();
        btnLeftMargin = new javax.swing.JButton();
        jPanel30 = new javax.swing.JPanel();
        numTFRM = new javax.swing.JSpinner();
        btnRightMargin = new javax.swing.JButton();
        jPanel31 = new javax.swing.JPanel();
        cbAlignment = new javax.swing.JComboBox();
        btnAlignment = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        txtLog = new javax.swing.JTextArea();
        jLabel6 = new javax.swing.JLabel();
        rbhex = new javax.swing.JRadioButton();
        rbascii = new javax.swing.JRadioButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        helpBox = new javax.swing.JEditorPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        miExit = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("StarIO Line Mode Java SDK");
        setResizable(false);

        jTabbedPane1.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
        jTabbedPane1.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabbedPane1StateChanged(evt);
            }
        });

        jPanel1.setLayout(null);
        jLabel1.setFont(new java.awt.Font("Trebuchet MS", 0, 24)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(0, 51, 255));
        jLabel1.setText("StarIO Line Mode Java ADK");
		
        jPanel1.add(jLabel1);
        jLabel1.setBounds(300, 30, 200, 50);
        jPanel1.add(jSeparator1);
        jSeparator1.setBounds(0, 90, 600, 10);

        jLabel2.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        jLabel2.setText("Port Info");
        jPanel1.add(jLabel2);
        jLabel2.setBounds(100, 100, 100, 50);

        jLabel4.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel4.setText("Port Settings:");
        jPanel1.add(jLabel4);

        starLogo.setFont(new java.awt.Font("Trebuchet MS", 0, 12)); // NOI18N
        starLogo.setIcon(new javax.swing.ImageIcon("C:/Users/Scorpion/workspace2/TestCamera/resources/star-logo.gif")); // NOI18N
        jPanel1.add(starLogo);
        starLogo.setBounds(50, 10, 170, 100);
        
        txtPortName.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        txtPortName.setText("usbven:");
        jPanel1.add(txtPortName);
        txtPortName.setBounds(110, 160,100,30);
        
        txtPortSettings.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jPanel1.add(txtPortSettings);
        txtPortSettings.setBounds(110, 200,100,30);
        
        btnPrintSampleR.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        btnPrintSampleR.setText("Print Sample Receipt");
        btnPrintSampleR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrintSampleRActionPerformed(evt);
            }
        });
        jPanel1.add(btnPrintSampleR);
        btnPrintSampleR.setBounds(20, 240, 230, 30);

        btnOpenCashD.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        btnOpenCashD.setText("Open Cash Drawer");
        btnOpenCashD.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnOpenCashDActionPerformed(evt);
            }
        });
        jPanel1.add(btnOpenCashD);
        btnOpenCashD.setBounds(20, 280, 230, 30);

        btnMonitoring.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        btnMonitoring.setText("Get Current Printer Status");
        btnMonitoring.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMonitoringActionPerformed(evt);
            }
        });
        jPanel1.add(btnMonitoring);
        btnMonitoring.setBounds(310, 320, 270, 30);

        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jPanel1.add(jSeparator2);
		jSeparator2.setBounds(290, 90, 10, 280);
        jPanel1.add(jSeparator4);
		jSeparator4.setBounds(0, 130, 290, 10);

        btnCheckBlock.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        btnCheckBlock.setText("Check Block (ETB)");
        btnCheckBlock.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCheckBlockActionPerformed(evt);
            }
        });
        jPanel1.add(btnCheckBlock);
		btnCheckBlock.setBounds(20, 320, 230, 30);
		
        jScrollPane3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Printer Status", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 18))); // NOI18N
        jScrollPane3.setFont(new java.awt.Font("Trebuchet MS", 0, 12));

        txtStatus.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        txtStatus.setForeground(new java.awt.Color(0, 0, 255));
        txtStatus.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jScrollPane3.setViewportView(txtStatus);

        jPanel1.add(jScrollPane3);
		jScrollPane3.setBounds(310, 100, 270, 210);
		
        jLabel22.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel22.setText("Port Name:");
        jPanel1.add(jLabel22);
		jLabel22.setBounds(20, 160, 80, 50);

        jTabbedPane1.addTab("Communication", jPanel1);
        
        jTabbedPane2.setFont(new java.awt.Font("Trebuchet MS", 0, 12));

        jPanel9.setFont(new java.awt.Font("Trebuchet MS", 0, 12));

        btnCode39.setFont(new java.awt.Font("Trebuchet MS", 0, 24));
        btnCode39.setText("Print Code 39");
        btnCode39.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCode39ActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel3.setText("Barcode Data:");

        jLabel7.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel7.setText("Barcode Height:");

        txtcode39data.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        txtcode39data.setText("1234567890");

        numcode39.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numcode39.setValue(80);

        jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Narrow : Wide ( dots )", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        grpcode39.add(rb1code39);
        rb1code39.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb1code39.setSelected(true);
        rb1code39.setText("2 : 6");

        grpcode39.add(rb2code39);
        rb2code39.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb2code39.setText("3 : 9");

        grpcode39.add(rb3code39);
        rb3code39.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb3code39.setText("4 : 12");

        grpcode39.add(rb6code39);
        rb6code39.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb6code39.setText("4 : 10");

        grpcode39.add(rb5code39);
        rb5code39.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb5code39.setText("3 : 8");

        grpcode39.add(rb4code39);
        rb4code39.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb4code39.setText("2 : 5");

        grpcode39.add(rb9code39);
        rb9code39.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb9code39.setText("4 : 8");

        grpcode39.add(rb8code39);
        rb8code39.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb8code39.setText("3 : 6");

        grpcode39.add(rb7code39);
        rb7code39.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb7code39.setText("2 : 4");

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rb3code39)
                    .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(rb1code39)
                        .addComponent(rb2code39)))
                .addGap(29, 29, 29)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rb6code39)
                    .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(rb4code39)
                        .addComponent(rb5code39)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rb9code39)
                    .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(rb7code39)
                        .addComponent(rb8code39)))
                .addGap(14, 14, 14))
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(rb7code39)
                        .addGap(3, 3, 3)
                        .addComponent(rb8code39)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rb9code39))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(rb4code39)
                        .addGap(3, 3, 3)
                        .addComponent(rb5code39)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rb6code39))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(rb1code39)
                        .addGap(3, 3, 3)
                        .addComponent(rb2code39)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rb3code39)))
                .addContainerGap(18, Short.MAX_VALUE))
        );

        code39.setFont(new java.awt.Font("Trebuchet MS", 0, 12)); // NOI18N
        code39.setIcon(new javax.swing.ImageIcon("C:/Users/Scorpion/workspace2/TestCamera/resources/code39.gif")); // NOI18N

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel13, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel9Layout.createSequentialGroup()
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel7))
                        .addGap(28, 28, 28)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(numcode39)
                            .addComponent(txtcode39data, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE))))
                .addGap(18, 18, 18)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(btnCode39, javax.swing.GroupLayout.DEFAULT_SIZE, 283, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                        .addComponent(code39)
                        .addGap(79, 79, 79))))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(txtcode39data, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(numcode39, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(code39)
                        .addGap(18, 18, 18)
                        .addComponent(btnCode39, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Code 39", jPanel9);

        jLabel8.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel8.setText("Barcode Data:");

        txti2of5data.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        txti2of5data.setText("1234567890");

        jLabel9.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel9.setText("Barcode Height:");

        numi2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numi2of5.setValue(80);

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Narrow : Wide ( dots )", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        grpi25.add(rb1i2of5);
        rb1i2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb1i2of5.setSelected(true);
        rb1i2of5.setText("2 : 6");

        grpi25.add(rb2i2of5);
        rb2i2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb2i2of5.setText("3 : 9");

        grpi25.add(rb3i2of5);
        rb3i2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb3i2of5.setText("4 : 12");

        grpi25.add(rb6i2of5);
        rb6i2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb6i2of5.setText("4 : 10");

        grpi25.add(rb5i2of5);
        rb5i2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb5i2of5.setText("3 : 8");

        grpi25.add(rb4i2of5);
        rb4i2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb4i2of5.setText("2 : 5");

        grpi25.add(rb9i2of5);
        rb9i2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb9i2of5.setText("4 : 8");

        grpi25.add(rb8i2of5);
        rb8i2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb8i2of5.setText("3 : 6");

        grpi25.add(rb7i2of5);
        rb7i2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb7i2of5.setText("2 : 4");

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rb3i2of5)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(rb1i2of5)
                        .addComponent(rb2i2of5)))
                .addGap(29, 29, 29)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rb6i2of5)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(rb4i2of5)
                        .addComponent(rb5i2of5)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rb9i2of5)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(rb7i2of5)
                        .addComponent(rb8i2of5)))
                .addGap(14, 14, 14))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(rb7i2of5)
                        .addGap(3, 3, 3)
                        .addComponent(rb8i2of5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rb9i2of5))
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(rb4i2of5)
                        .addGap(3, 3, 3)
                        .addComponent(rb5i2of5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rb6i2of5))
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(rb1i2of5)
                        .addGap(3, 3, 3)
                        .addComponent(rb2i2of5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rb3i2of5)))
                .addContainerGap(18, Short.MAX_VALUE))
        );

        btni2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 24));
        btni2of5.setText("Print Interleaved 2 of 5");
        btni2of5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btni2of5ActionPerformed(evt);
            }
        });

        i2of5.setFont(new java.awt.Font("Trebuchet MS", 0, 12)); // NOI18N
        i2of5.setIcon(new javax.swing.ImageIcon("C:/Users/Scorpion/workspace2/TestCamera/resources/i2of5.gif")); // NOI18N

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel14, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel10Layout.createSequentialGroup()
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel8)
                            .addComponent(jLabel9))
                        .addGap(28, 28, 28)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(numi2of5)
                            .addComponent(txti2of5data, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE))))
                .addGap(18, 18, 18)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addComponent(btni2of5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                        .addComponent(i2of5)
                        .addGap(66, 66, 66))))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(i2of5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                        .addComponent(btni2of5, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel10Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8)
                            .addComponent(txti2of5data, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(numi2of5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Interleaved 2 of 5", jPanel10);

        jLabel10.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel10.setText("Barcode Data:");

        btncode93.setFont(new java.awt.Font("Trebuchet MS", 0, 24));
        btncode93.setText("Print Code 93");
        btncode93.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btncode93ActionPerformed(evt);
            }
        });

        jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Minimum Module Size ( dots )", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        grpcode93.add(rb1code93);
        rb1code93.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb1code93.setSelected(true);
        rb1code93.setText("2");

        grpcode93.add(rb2code93);
        rb2code93.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb2code93.setText("3");

        grpcode93.add(rb3code93);
        rb3code93.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb3code93.setText("4");

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addComponent(rb1code93)
                .addGap(52, 52, 52)
                .addComponent(rb2code93)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 55, Short.MAX_VALUE)
                .addComponent(rb3code93)
                .addGap(31, 31, 31))
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(rb2code93)
                        .addComponent(rb3code93))
                    .addComponent(rb1code93))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        txtcode93.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        txtcode93.setText("1234567890");

        jLabel11.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel11.setText("Barcode Height:");

        numcode93.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numcode93.setValue(80);

        code93.setFont(new java.awt.Font("Trebuchet MS", 0, 12)); // NOI18N
        code93.setIcon(new javax.swing.ImageIcon("C:/Users/Scorpion/workspace2/TestCamera/resources/code93.gif")); // NOI18N

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addGap(28, 28, 28)
                        .addComponent(numcode93, javax.swing.GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addGap(40, 40, 40)
                        .addComponent(txtcode93, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(btncode93, javax.swing.GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(66, 66, 66)
                        .addComponent(code93)))
                .addContainerGap())
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel10)
                            .addComponent(txtcode93, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel11)
                            .addComponent(numcode93, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(53, 53, 53)
                        .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(code93)
                        .addGap(18, 18, 18)
                        .addComponent(btncode93, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)))
                .addContainerGap())
        );

        jTabbedPane2.addTab("Code 93", jPanel11);

        jLabel13.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel13.setText("Barcode Data:");

        txtcode128.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        txtcode128.setText("1234567890");

        jLabel14.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel14.setText("Barcode Height:");

        numcode128.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numcode128.setValue(80);

        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Minimum Module Size ( dots )", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        grpcode128.add(rb1code128);
        rb1code128.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb1code128.setSelected(true);
        rb1code128.setText("2");

        grpcode128.add(rb2code128);
        rb2code128.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb2code128.setText("3");

        grpcode128.add(rb3code128);
        rb3code128.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rb3code128.setText("4");

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addComponent(rb1code128)
                .addGap(58, 58, 58)
                .addComponent(rb2code128)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 57, Short.MAX_VALUE)
                .addComponent(rb3code128)
                .addGap(39, 39, 39))
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rb1code128)
                    .addComponent(rb2code128)
                    .addComponent(rb3code128))
                .addContainerGap(5, Short.MAX_VALUE))
        );

        btncode128.setFont(new java.awt.Font("Trebuchet MS", 0, 24));
        btncode128.setText("Print Code 128");
        btncode128.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btncode128ActionPerformed(evt);
            }
        });

        jLabel21.setFont(new java.awt.Font("Trebuchet MS", 0, 12)); // NOI18N
        jLabel21.setIcon(new javax.swing.ImageIcon("C:/Users/Scorpion/workspace2/TestCamera/resources/code128.gif")); // NOI18N

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel13)
                            .addComponent(jLabel14))
                        .addGap(28, 28, 28)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(numcode128)
                            .addComponent(txtcode128, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 97, Short.MAX_VALUE)
                        .addComponent(jLabel21)
                        .addGap(84, 84, 84))
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(18, 18, 18)
                        .addComponent(btncode128, javax.swing.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE)
                        .addContainerGap())))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel13)
                            .addComponent(txtcode128, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel14)
                            .addComponent(numcode128, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel21)))
                .addGap(18, 18, 18)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel16, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btncode128, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(35, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Code 128", jPanel12);

        jLabel12.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        jLabel12.setText("Layout");

        cb1DBarcodeOption.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        cb1DBarcodeOption.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No under-car characters & execute line feed", "Add under-car characters & execute line feed", "No under-car characters & do not execute line feed", "Add under-car characters & do not execute line feed" }));

        code128.setFont(new java.awt.Font("Trebuchet MS", 0, 12)); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTabbedPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 584, Short.MAX_VALUE)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel12)
                                .addGap(18, 18, 18)
                                .addComponent(cb1DBarcodeOption, 0, 523, Short.MAX_VALUE)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(code128)
                        .addGap(213, 213, 213))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(code128)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 263, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(37, 37, 37)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(cb1DBarcodeOption, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(30, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("1D Barcodes", jPanel2);

        jTabbedPane3.setFont(new java.awt.Font("Trebuchet MS", 0, 12));

        jPanel19.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Barcode Data", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        txtQRdata.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        txtQRdata.setText("http://www.StarMicronics.com");

        javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
        jPanel19.setLayout(jPanel19Layout);
        jPanel19Layout.setHorizontalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(txtQRdata, javax.swing.GroupLayout.PREFERRED_SIZE, 527, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel19Layout.setVerticalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addComponent(txtQRdata, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel21.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Model", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        cbQRmodel.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        cbQRmodel.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Model 1", "Model 2" }));
        cbQRmodel.setSelectedIndex(1);

        javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
        jPanel21.setLayout(jPanel21Layout);
        jPanel21Layout.setHorizontalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel21Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(cbQRmodel, 0, 159, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel21Layout.setVerticalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel21Layout.createSequentialGroup()
                .addComponent(cbQRmodel, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel22.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cell Size", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        numQRcellsize.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numQRcellsize.setValue(3);

        javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22);
        jPanel22.setLayout(jPanel22Layout);
        jPanel22Layout.setHorizontalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 179, Short.MAX_VALUE)
            .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel22Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(numQRcellsize, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                    .addContainerGap()))
        );
        jPanel22Layout.setVerticalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 40, Short.MAX_VALUE)
            .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel22Layout.createSequentialGroup()
                    .addGap(7, 7, 7)
                    .addComponent(numQRcellsize, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        jPanel23.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Correction Level", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        cbQRecc.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        cbQRecc.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "L  7%", "M  15%", "Q  25%", "H  30%" }));

        javax.swing.GroupLayout jPanel23Layout = new javax.swing.GroupLayout(jPanel23);
        jPanel23.setLayout(jPanel23Layout);
        jPanel23Layout.setHorizontalGroup(
            jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel23Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(cbQRecc, 0, 159, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel23Layout.setVerticalGroup(
            jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel23Layout.createSequentialGroup()
                .addContainerGap(48, Short.MAX_VALUE)
                .addComponent(cbQRecc, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(43, 43, 43))
        );

        jLabel15.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel15.setText("Step 1");

        btnQRmodel.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        btnQRmodel.setText("Set Model");
        btnQRmodel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnQRmodelActionPerformed(evt);
            }
        });

        jLabel16.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel16.setText("Step 2");

        btnQRecc.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        btnQRecc.setText("Correction Lvl");
        btnQRecc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnQReccActionPerformed(evt);
            }
        });

        jLabel17.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel17.setText("Step 3");

        btnQRcellsize.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        btnQRcellsize.setText("Cell Size");
        btnQRcellsize.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnQRcellsizeActionPerformed(evt);
            }
        });

        jLabel18.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel18.setText("Step 4");

        btnQRdata.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        btnQRdata.setText("Barcode Data");
        btnQRdata.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnQRdataActionPerformed(evt);
            }
        });

        jLabel19.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel19.setText("Step 5");

        btnQRprint.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        btnQRprint.setText("Print");
        btnQRprint.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnQRprintActionPerformed(evt);
            }
        });

        jLabel20.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel20.setText("Run All Steps");

        btnQRall.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        btnQRall.setText("Set All");
        btnQRall.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnQRallActionPerformed(evt);
            }
        });

        qrcodes.setFont(new java.awt.Font("Trebuchet MS", 0, 11)); // NOI18N
        qrcodes.setIcon(new javax.swing.ImageIcon("C:/Users/Scorpion/workspace2/TestCamera/resources/qrcode.gif")); // NOI18N

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(qrcodes)
                        .addGap(40, 40, 40)
                        .addComponent(jPanel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel21, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel22, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnQRmodel)
                            .addGroup(jPanel17Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel15)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnQRecc)
                            .addGroup(jPanel17Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel16)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnQRcellsize)
                            .addGroup(jPanel17Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel17)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnQRdata)
                            .addGroup(jPanel17Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel18)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnQRprint)
                            .addGroup(jPanel17Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel19)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btnQRall)
                            .addComponent(jLabel20)))
                    .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(11, Short.MAX_VALUE))
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addComponent(qrcodes))
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel17Layout.createSequentialGroup()
                                .addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jPanel23, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnQRmodel, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnQRecc, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnQRcellsize, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnQRdata, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel19)
                            .addComponent(jLabel20))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnQRprint, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(btnQRall, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jTabbedPane3.addTab("QR Code", jPanel17);

        jPanel24.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Barcode Data", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        txtPDFdata.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        txtPDFdata.setText("http://www.StarMicronics.com");

        btnPDFdata.setText("Set");
        btnPDFdata.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPDFdataActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel24Layout = new javax.swing.GroupLayout(jPanel24);
        jPanel24.setLayout(jPanel24Layout);
        jPanel24Layout.setHorizontalGroup(
            jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel24Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(txtPDFdata, javax.swing.GroupLayout.PREFERRED_SIZE, 263, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnPDFdata)
                .addGap(12, 12, 12))
        );
        jPanel24Layout.setVerticalGroup(
            jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel24Layout.createSequentialGroup()
                .addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtPDFdata, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnPDFdata))
                .addContainerGap(6, Short.MAX_VALUE))
        );

        jPanel25.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Barcode Size", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        grppdf417.add(rbPDF1);
        rbPDF1.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rbPDF1.setSelected(true);
        rbPDF1.setText("USE_LIMITS");

        grppdf417.add(rbPDF2);
        rbPDF2.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rbPDF2.setText("USE_FIXED");
        rbPDF2.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                rbPDF2StateChanged(evt);
            }
        });

        lblPDFw.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        lblPDFw.setText("Width:");

        lblPDFh.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        lblPDFh.setText("Height:");

        numPDFw.setValue(2);

        numPDFh.setValue(1);

        btnPDFsize.setText("Set");
        btnPDFsize.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPDFsizeActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel25Layout = new javax.swing.GroupLayout(jPanel25);
        jPanel25.setLayout(jPanel25Layout);
        jPanel25Layout.setHorizontalGroup(
            jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel25Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rbPDF1)
                    .addComponent(rbPDF2))
                .addGap(81, 81, 81)
                .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lblPDFh)
                    .addComponent(lblPDFw))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(numPDFw, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(numPDFh, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(107, 107, 107)
                .addComponent(btnPDFsize, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel25Layout.setVerticalGroup(
            jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel25Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel25Layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addComponent(rbPDF1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rbPDF2))
                    .addComponent(btnPDFsize, javax.swing.GroupLayout.DEFAULT_SIZE, 52, Short.MAX_VALUE)
                    .addGroup(jPanel25Layout.createSequentialGroup()
                        .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblPDFh)
                            .addComponent(numPDFh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblPDFw)
                            .addComponent(numPDFw, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        jPanel26.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Aspect Ratio", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        numPDFratio.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numPDFratio.setValue(3);

        btnPDFratio.setText("Set");
        btnPDFratio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPDFratioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel26Layout = new javax.swing.GroupLayout(jPanel26);
        jPanel26.setLayout(jPanel26Layout);
        jPanel26Layout.setHorizontalGroup(
            jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel26Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(numPDFratio, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnPDFratio)
                .addGap(12, 12, 12))
        );
        jPanel26Layout.setVerticalGroup(
            jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel26Layout.createSequentialGroup()
                .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(numPDFratio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnPDFratio))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel27.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "X-Dim ( dots )", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        numPDFxdim.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numPDFxdim.setValue(3);

        btnPDFxdim.setText("Set");
        btnPDFxdim.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPDFxdimActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel27Layout = new javax.swing.GroupLayout(jPanel27);
        jPanel27.setLayout(jPanel27Layout);
        jPanel27Layout.setHorizontalGroup(
            jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel27Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(numPDFxdim, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnPDFxdim)
                .addGap(24, 24, 24))
        );
        jPanel27Layout.setVerticalGroup(
            jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel27Layout.createSequentialGroup()
                .addGroup(jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(numPDFxdim, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnPDFxdim))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel28.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Security Level", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        numPDFecc.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numPDFecc.setValue(3);

        btnPDFecc.setText("Set");
        btnPDFecc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPDFeccActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel28Layout = new javax.swing.GroupLayout(jPanel28);
        jPanel28.setLayout(jPanel28Layout);
        jPanel28Layout.setHorizontalGroup(
            jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel28Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(numPDFecc, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnPDFecc)
                .addGap(6, 6, 6))
        );
        jPanel28Layout.setVerticalGroup(
            jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel28Layout.createSequentialGroup()
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(numPDFecc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnPDFecc))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        btnPDFall.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnPDFall.setText("Set All and Print PDF417");
        btnPDFall.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPDFallActionPerformed(evt);
            }
        });

        lblPDFh1.setFont(new java.awt.Font("Trebuchet MS", 0, 12)); // NOI18N
        lblPDFh1.setIcon(new javax.swing.ImageIcon("C:/Users/Scorpion/workspace2/TestCamera/resources/pdf417.gif")); // NOI18N

        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
        jPanel18.setLayout(jPanel18Layout);
        jPanel18Layout.setHorizontalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel18Layout.createSequentialGroup()
                        .addGap(30, 30, 30)
                        .addComponent(lblPDFh1))
                    .addGroup(jPanel18Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel18Layout.createSequentialGroup()
                                .addComponent(jPanel26, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jPanel27, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jPanel28, 0, 171, Short.MAX_VALUE))
                            .addComponent(jPanel24, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel25, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel18Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(btnPDFall, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(27, Short.MAX_VALUE))
        );
        jPanel18Layout.setVerticalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel18Layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(lblPDFh1))
                    .addGroup(jPanel18Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel24, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel27, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel26, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addComponent(btnPDFall, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jTabbedPane3.addTab("PDF417", jPanel18);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 585, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane3)
                .addContainerGap())
        );

        jTabbedPane1.addTab("2D Barcodes", jPanel3);

        jLabel23.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel23.setText("Code Page #:");

        jLabel24.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel24.setText("Text To Print:");

        cbCodePage.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        cbCodePage.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Normal*", "437 (USA, Std. Europe)", "Katakana", "437 (USA, Std. Europe)", "858 (Multilingual)", "852 (Latin-2)", "860 (Portuguese)", "861 (Icelandic)", "863 (Canadian French)", "865 (Nordic)", "866 (Cyrillic Russian)", "855 (Cyrillic Bulgarian)", "857 (Turkey)", "862 (Israel (Hebrew) )", "864 (Arabic)", "737 (Greek)", "851 (Greek) - (Not Supported by JVM) ", "869 (Greek)", "928 (Greek) - (Not Supported by JVM) ", "772 (Lithuanian) - (Not Supported by JVM) ", "774 (Lithuanian) - (Not Supported by JVM) ", "874 (Thai)", "1252 (Windows Latin-1)", "1250 (Windows Latin-2)", "1251 (Windows Cyrillic)", "3840 (IBM-Russian) - (Not Supported by JVM) ", "3841 (Gost) - (Not Supported by JVM) ", "3843 (Polish) - (Not Supported by JVM) ", "3844 (CS2) - (Not Supported by JVM) ", "3845 (Hungarian) - (Not Supported by JVM) ", "3846 (Turkish) - (Not Supported by JVM) ", "3847 (Brazil-ABNT) - (Not Supported by JVM) ", "3848 (Brazil-ABICOMP) - (Not Supported by JVM) ", "1001 (Arabic) - (Not Supported by JVM) ", "2001 (Lithuanian-KBL) - (Not Supported by JVM) ", "3001 (Estonian-1) - (Not Supported by JVM) ", "3002 (Estonian-2) - (Not Supported by JVM) ", "3011 (Latvian-1) - (Not Supported by JVM) ", "3012 (Latvian-2) - (Not Supported by JVM) ", "3021 (Bulgarian) - (Not Supported by JVM) ", "3041 (Maltese) - (Not Supported by JVM) " }));

        txtCodePage.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        txtCodePage.setText("Put Code Page Text Matching Your Selection");

        jLabel25.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel25.setText("<html><i>If you do not put at least the minimum amount of<br />characters than the line buffer of the paper width<br />the printer will not print until the line buffer is full.</i></html>");

        btnCodePage.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnCodePage.setText("Set Code Page and Print String");
        btnCodePage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCodePageActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(73, 73, 73)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(btnCodePage, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel23)
                        .addGap(18, 18, 18)
                        .addComponent(cbCodePage, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel24)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtCodePage))))
                .addContainerGap(50, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(49, 49, 49)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(cbCodePage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(61, 61, 61)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(txtCodePage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(66, 66, 66)
                .addComponent(btnCodePage, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)
                .addGap(41, 41, 41))
        );

        jTabbedPane1.addTab("Code Pages", jPanel4);

        btnFontA.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnFontA.setText("Set Font A");
        btnFontA.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFontAActionPerformed(evt);
            }
        });

        btnFontB.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnFontB.setText("Set Font B");
        btnFontB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFontBActionPerformed(evt);
            }
        });

        brnFontOCR.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        brnFontOCR.setText("Set OCR-B");
        brnFontOCR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                brnFontOCRActionPerformed(evt);
            }
        });

        jLabel26.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        jLabel26.setText("Font-B (9 x 24 dots)");

        jLabel27.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        jLabel27.setText("Font-A (12 x 24 dots)");

        jLabel28.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        jLabel28.setText("OCR-B (16 x 24 dots)");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnFontB, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnFontA, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(brnFontOCR, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel26)
                    .addComponent(jLabel28))
                .addContainerGap(45, Short.MAX_VALUE))
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                    .addContainerGap(396, Short.MAX_VALUE)
                    .addComponent(jLabel27)
                    .addGap(40, 40, 40)))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addComponent(btnFontA, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)
                .addGap(81, 81, 81)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnFontB, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)
                    .addComponent(jLabel26))
                .addGap(77, 77, 77)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(brnFontOCR, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)
                    .addComponent(jLabel28))
                .addGap(34, 34, 34))
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel5Layout.createSequentialGroup()
                    .addGap(56, 56, 56)
                    .addComponent(jLabel27)
                    .addContainerGap(294, Short.MAX_VALUE)))
        );

        jTabbedPane1.addTab("Font", jPanel5);

        btnLF.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        btnLF.setText("Line Feed");
        btnLF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLFActionPerformed(evt);
            }
        });

        btnLF4mm.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        btnLF4mm.setText("Set Line Feed to 4mm");
        btnLF4mm.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLF4mmActionPerformed(evt);
            }
        });

        btnLF3mm.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        btnLF3mm.setText("Set Line Feed to 3mm");
        btnLF3mm.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLF3mmActionPerformed(evt);
            }
        });

        btnMLF.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        btnMLF.setText("Multi Line Feed");
        btnMLF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMLFActionPerformed(evt);
            }
        });

        btnLS3mm.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        btnLS3mm.setText("Set Line Spacing to 3mm");
        btnLS3mm.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLS3mmActionPerformed(evt);
            }
        });

        btnL4mm.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        btnL4mm.setText("Set 4mm Lines");
        btnL4mm.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnL4mmActionPerformed(evt);
            }
        });

        btnL8mm.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        btnL8mm.setText("Set 8mm Lines");
        btnL8mm.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnL8mmActionPerformed(evt);
            }
        });

        btnFF.setFont(new java.awt.Font("Trebuchet MS", 0, 14));
        btnFF.setText("Form Feed");
        btnFF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFFActionPerformed(evt);
            }
        });

        numMLF.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numMLF.setValue(3);

        numL4mm.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numL4mm.setValue(3);

        numL8mm.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numL8mm.setValue(3);

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnLF, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnLF4mm, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnLF3mm, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnLS3mm, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnFF, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel6Layout.createSequentialGroup()
                            .addComponent(btnMLF, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(10, 10, 10)
                            .addComponent(numMLF))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel6Layout.createSequentialGroup()
                            .addComponent(btnL4mm, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(10, 10, 10)
                            .addComponent(numL4mm))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel6Layout.createSequentialGroup()
                            .addComponent(btnL8mm, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(10, 10, 10)
                            .addComponent(numL8mm, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(108, 108, 108))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnLF, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnLF4mm, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnLF3mm, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnMLF, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(numMLF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnLS3mm, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnL4mm, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(numL4mm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnL8mm, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(numL8mm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnFF, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(38, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Feed", jPanel6);

        btnFullCut.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnFullCut.setText("Full Cut");
        btnFullCut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFullCutActionPerformed(evt);
            }
        });

        btnFeedFullCut.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnFeedFullCut.setText("Feed and Full Cut");
        btnFeedFullCut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFeedFullCutActionPerformed(evt);
            }
        });

        btnPartialCut.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnPartialCut.setText("Partial Cut");
        btnPartialCut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPartialCutActionPerformed(evt);
            }
        });

        btnFeedPartialCut.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnFeedPartialCut.setText("Feed and Partial Cut");
        btnFeedPartialCut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFeedPartialCutActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(143, 143, 143)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnFeedPartialCut, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnFeedFullCut, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnPartialCut, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnFullCut, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(144, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(50, 50, 50)
                .addComponent(btnFullCut, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(btnPartialCut, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(btnFeedFullCut, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(btnFeedPartialCut, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)
                .addGap(71, 71, 71))
        );

        jTabbedPane1.addTab("Cut", jPanel7);

        jPanel20.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Decoration", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        chkTFslashz.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        chkTFslashz.setText("Slashed Zero");

        chkTFbold.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        chkTFbold.setText("Emphasized");

        chkTFunderline.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        chkTFunderline.setText("Underline");

        chkTFupperline.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        chkTFupperline.setText("Upperline");

        chkTFinvert.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        chkTFinvert.setText("Invert Color");

        chkTFupsidedown.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        chkTFupsidedown.setText("Upside-Down");

        jLabel29.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel29.setText("Height Expansion:");

        jLabel30.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        jLabel30.setText("Width Expansion:");

        numTFh.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numTFh.setValue(0);

        numTFw.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numTFw.setValue(0);

        btnPrintTF.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnPrintTF.setText("Set Text Formatting");
        btnPrintTF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrintTFActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
        jPanel20.setLayout(jPanel20Layout);
        jPanel20Layout.setHorizontalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(chkTFslashz)
                    .addComponent(chkTFunderline)
                    .addComponent(chkTFinvert))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 77, Short.MAX_VALUE)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(chkTFupsidedown)
                    .addComponent(chkTFupperline)
                    .addComponent(chkTFbold))
                .addGap(25, 25, 25))
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addGap(39, 39, 39)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel20Layout.createSequentialGroup()
                        .addComponent(jLabel30)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(numTFw, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel20Layout.createSequentialGroup()
                        .addComponent(jLabel29)
                        .addGap(18, 18, 18)
                        .addComponent(numTFh, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(71, Short.MAX_VALUE))
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnPrintTF, javax.swing.GroupLayout.DEFAULT_SIZE, 283, Short.MAX_VALUE)
                .addGap(24, 24, 24))
        );
        jPanel20Layout.setVerticalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chkTFslashz)
                    .addComponent(chkTFbold))
                .addGap(18, 18, 18)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chkTFunderline)
                    .addComponent(chkTFupperline))
                .addGap(18, 18, 18)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chkTFinvert)
                    .addComponent(chkTFupsidedown))
                .addGap(35, 35, 35)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel29)
                    .addComponent(numTFh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(39, 39, 39)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(numTFw, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(34, 34, 34)
                .addComponent(btnPrintTF, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel29.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Left Margin", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        numTFLM.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numTFLM.setValue(1);

        btnLeftMargin.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnLeftMargin.setText("Set");
        btnLeftMargin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLeftMarginActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel29Layout = new javax.swing.GroupLayout(jPanel29);
        jPanel29.setLayout(jPanel29Layout);
        jPanel29Layout.setHorizontalGroup(
            jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel29Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(numTFLM, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30)
                .addComponent(btnLeftMargin, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(34, Short.MAX_VALUE))
        );
        jPanel29Layout.setVerticalGroup(
            jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel29Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnLeftMargin, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(numTFLM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(23, Short.MAX_VALUE))
        );

        jPanel30.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Right Margin", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        numTFRM.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        numTFRM.setValue(1);

        btnRightMargin.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnRightMargin.setText("Set");
        btnRightMargin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRightMarginActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel30Layout = new javax.swing.GroupLayout(jPanel30);
        jPanel30.setLayout(jPanel30Layout);
        jPanel30Layout.setHorizontalGroup(
            jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel30Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(numTFRM, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30)
                .addComponent(btnRightMargin, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(35, Short.MAX_VALUE))
        );
        jPanel30Layout.setVerticalGroup(
            jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel30Layout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(numTFRM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnRightMargin, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(29, Short.MAX_VALUE))
        );

        jPanel31.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Alignment", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 0, 12))); // NOI18N

        cbAlignment.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        cbAlignment.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Left", "Center", "Right" }));

        btnAlignment.setFont(new java.awt.Font("Trebuchet MS", 0, 18));
        btnAlignment.setText("Set");
        btnAlignment.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAlignmentActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel31Layout = new javax.swing.GroupLayout(jPanel31);
        jPanel31.setLayout(jPanel31Layout);
        jPanel31Layout.setHorizontalGroup(
            jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel31Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(cbAlignment, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30)
                .addComponent(btnAlignment, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(35, Short.MAX_VALUE))
        );
        jPanel31Layout.setVerticalGroup(
            jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel31Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cbAlignment, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAlignment, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(29, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel30, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel31, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                    .addContainerGap(346, Short.MAX_VALUE)
                    .addComponent(jPanel29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                        .addComponent(jPanel30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel20, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel8Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jPanel29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(252, Short.MAX_VALUE)))
        );

        jTabbedPane1.addTab("Text Formatting", jPanel8);

        txtLog.setColumns(20);
        txtLog.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        txtLog.setLineWrap(true);
        txtLog.setRows(5);
        jScrollPane2.setViewportView(txtLog);

        jLabel6.setFont(new java.awt.Font("Trebuchet MS", 0, 11));
        jLabel6.setText("Output To Printer:");

        logRadioGrp.add(rbhex);
        rbhex.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rbhex.setSelected(true);
        rbhex.setText("Hex Mode");

        logRadioGrp.add(rbascii);
        rbascii.setFont(new java.awt.Font("Trebuchet MS", 0, 12));
        rbascii.setText("ASCII Mode");

        helpBox.setEditable(false);
        jScrollPane1.setViewportView(helpBox);

        jMenu1.setText("File");
        jMenu1.setFont(new java.awt.Font("Trebuchet MS", 0, 12));

        miExit.setText("Exit");
        miExit.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                miExitMouseClicked(evt);
            }
        });
        jMenu1.add(miExit);

        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(rbhex)
                            .addComponent(rbascii)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 504, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jTabbedPane1, 0, 0, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 491, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 399, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addGap(11, 11, 11)
                                .addComponent(rbhex)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(rbascii))
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        jTabbedPane1.getAccessibleContext().setAccessibleName("Communication");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    //For menu item Exit to close application
    private void miExitMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_miExitMouseClicked
        System.exit(0);
    }//GEN-LAST:event_miExitMouseClicked

    /*
     * Print Sample Receipt
     *
     * This is a great block of code to get right into printing a professional receipt.
     * Explore the different commands and how each command can set the printer to format your text accordingly.
     * 
     */
    private void btnPrintSampleRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintSampleRActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            Byte[] tempList;
            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x61, 0x01}));

            data = "[If loaded.. Logo1 goes here]\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1c, 0x70, 0x01, 0x00, '\r', '\n'}));  //Stored Logo Printing

            data = "Star Clothing Boutique\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "1150 King Georges Post Rd.\r\nEdison, NJ, 08837\r\n\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x61, 0x00})); // Alignment

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x44, 0x02, 0x10, 0x22, 0x00})); //Set horizontal tab

            data = "Date: 4/17/2008".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            list.addAll(Arrays.asList(new Byte[]{' ', 0x09, ' '}));   //Moving Horizontal Tab

            data = "Time: 9:10 PM\r\n------------------------------------------------\r\n\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x45})); // bold

            data = "SALE \r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x46})); // bolf off

            data = "SKU ".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            list.addAll(Arrays.asList(new Byte[]{0x09}));

            // notice that we use a unicode representation because that is how Java expresses these bytes at double byte unicode
            // This will TAB to the next horizontal position
            data = " Description   \u0009         Total\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "300678566 \u0009  PLAN T-SHIRT\u0009         10.99\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "300692003 \u0009  BLACK DENIM\u0009         29.99\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "300651148 \u0009  BLUE DENIM\u0009         29.99\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "300642980 \u0009  STRIPE DRESS\u0009         49.99\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "300638471 \u0009  BLACK BOOT\u0009         35.99\r\n\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "Subtotal \u0009\u0009        156.95\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "Tax \u0009\u0009         00.00\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "------------------------------------------------\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "Total".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            // Character expansion
            list.addAll(Arrays.asList(new Byte[]{0x06, 0x09, 0x1b, 0x69, 0x01, 0x01}));

            data = "        $156.95\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x69, 0x00, 0x00}));  //Cancel Character Expansion

            data = "------------------------------------------------\r\n\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "Charge\r\n159.95\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "Visa XXXX-XXXX-XXXX-0123\r\n\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = "\u001b\u0034Regimds and Exchanges\u001b\u0035\r\n".getBytes();  //Specify/Cencel White/Black Invert
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = ("Within " + "\u001b\u002d\u0001" + "30 days\u001b\u002d\u0000" + " with receipt\r\n").getBytes();  //Specify/Cancel Underline Printing
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = ("And tags attached\r\n\r\n").getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            //1d barcode example 
            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x61, 0x01}));
            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x62, 0x06, 0x02, 0x02}));

            data = (" 12ab34cd56\u001e\r\n").getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x64, 0x02}));      //Cut
            list.addAll(Arrays.asList(new Byte[]{0x07})); // Kick cash drawer

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success";
            } else {
                status += "Error\nCould not write all \ndata to the printer.";
            }
        } catch (StarIOPortException e) {
            status += "Failure to print sample\nCheck printer connection.";
             e  .printStackTrace();
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }

        txtStatus.setText(status);
    }//GEN-LAST:event_btnPrintSampleRActionPerformed

    /*
     * Open Cash Drawer
     */
    private void btnOpenCashDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOpenCashDActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            data = "\u0007".getBytes(); //string unicode byte to byte VIA getBytes()

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // See below for how we check this int to see if all data has been sent
            if (totalSizeCommunicated == data.length) {
                status += "Success";
            } else {
                status += "Error - Could not write all data to the printer.";
            }
        } catch (StarIOPortException e) {
            status += "Failure - see stack trace:";
            e.printStackTrace();
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        txtStatus.setText(status);
    }//GEN-LAST:event_btnOpenCashDActionPerformed

    /*
     * Check Block will verify if the data has been received by the printer by matching the byte count.
     */
    private void btnCheckBlockActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCheckBlockActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>"; // you can use html to format the label (cheating way to format text)

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT); //Open the port

            StarPrinterStatus starPrinterStatus; //Get status

            starPrinterStatus = port.beginCheckedBlock(); //Begin checked block
            
            if (starPrinterStatus.offline == true) {
                status += "Printer is Offline<br />Printing will not proceed<br />";
                return;
            }

            byte[] data = "Hello World!\n".getBytes();

            //For loop to print 50 Hello world lines and end the check block after to make sure all the data has been received
            for (int count = 0; count < 50; count++) {
                int totalSizeCommunicated = WritePortHelper(port, data); // see below
                if (totalSizeCommunicated != data.length) {
                    status += "Error<br />Could not write all data to the printer<br />";
                    return;
                }
            }

            //END CHECK BLOCK
            starPrinterStatus = port.endCheckedBlock();
            if (starPrinterStatus.offline == true) {
                status += "The printer is offline<br />Meaning that printing failed<br />";
            }

            status += "Successfully sent all data to printer!<br />";
        } catch (StarIOPortException e) {
            status += "Failure to Check Block<br />";
            //  e.printStackTrace();
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnCheckBlockActionPerformed

    /*
     * Status Monitoring
     */
    private void btnMonitoringActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMonitoringActionPerformed

        txtStatus.setText("");

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            //This is our StarPrinterStatus class object being created and sent status with the newly opened port handle
            StarPrinterStatus starPrinterStatus = port.retreiveStatus();

            //Is the printer offline?
            if (starPrinterStatus.offline == true) {
                status += "Offline<br />";
            } else {
                status += "Online<br />";
            }
            //Check Cash Drawer
            if (starPrinterStatus.compulsionSwitch == false) {
                status += "Drawer Closed<br />";
            } else if (starPrinterStatus.compulsionSwitch == true) {
                status += "Drawer Open<br />";
            }
            //Cover Open
            if (starPrinterStatus.coverOpen == true) {
                status += "Cover open<br />";
            } else if (starPrinterStatus.receiptPaperEmpty == true) {
                status += "Paper empty<br />";
            } else if (starPrinterStatus.receiptPaperNearEmptyInner == true) {
                status += "Paper near empty<br />";
            }


            status += "<br />Successfully Retrived Status";
        } catch (StarIOPortException e) {
            status += "<br />Failed to get status<br />Check your connection";
            //    e.printStackTrace();
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnMonitoringActionPerformed

    /*
     * Code 39 barcode
     */
    private void btnCode39ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCode39ActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>1D Barcode Code 39<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x62, 0x34})); // ESC b 4 (4 is code 39)

            int n2int = cb1DBarcodeOption.getSelectedIndex() + 1;
            list.addAll(Arrays.asList(new Byte[]{(byte) n2int})); //Under-bar and line feed options

            //Find out what size of module was selected
            if (rb1code39.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x31}));
            } else if (rb2code39.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x32}));
            } else if (rb3code39.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x33}));
            } else if (rb4code39.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x34}));
            } else if (rb5code39.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x35}));
            } else if (rb6code39.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x36}));
            } else if (rb7code39.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x37}));
            } else if (rb8code39.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x38}));
            } else if (rb9code39.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x39}));
            }

            //Get height of barcode
            String n4 = numcode39.getValue() + "";
            list.addAll(Arrays.asList(Byte.valueOf(n4)));

            //Barcode data
            String bcData = txtcode39data.getText();
            byte[] byteArray = bcData.getBytes("UTF-8");
            for (int index = 0; index < bcData.length(); index++) {
                list.addAll(Arrays.asList(byteArray[index]));
            }

            list.addAll(Arrays.asList(new Byte[]{0x1E}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } catch (UnsupportedEncodingException exp) {
            status += "Failure<br />UnsupportedEncodingException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnCode39ActionPerformed

    /*
     * Interleaved 2 of 5 barcode
     */
    private void btni2of5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btni2of5ActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>1D Barcode Interleaved 2 of 5<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x62, 0x35})); // ESC b 5 (5 is for interleaved2of5)

            int n2int = cb1DBarcodeOption.getSelectedIndex() + 1;
            list.addAll(Arrays.asList(new Byte[]{(byte) n2int})); //Under-bar and line feed options

            //Find out what size of module was selected
            if (rb1i2of5.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x31}));
            } else if (rb2i2of5.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x32}));
            } else if (rb3i2of5.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x33}));
            } else if (rb4i2of5.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x34}));
            } else if (rb5i2of5.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x35}));
            } else if (rb6i2of5.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x36}));
            } else if (rb7i2of5.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x37}));
            } else if (rb8i2of5.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x38}));
            } else if (rb9i2of5.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x39}));
            }

            //Get height of barcode
            String n4 = numi2of5.getValue() + "";
            list.addAll(Arrays.asList(Byte.valueOf(n4)));

            //Barcode data
            String bcData = txti2of5data.getText();
            byte[] byteArray = bcData.getBytes("UTF-8");
            for (int index = 0; index < bcData.length(); index++) {
                list.addAll(Arrays.asList(byteArray[index]));
            }

            list.addAll(Arrays.asList(new Byte[]{0x1E}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } catch (UnsupportedEncodingException exp) {
            status += "Failure<br />UnsupportedEncodingException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btni2of5ActionPerformed

    /*
     * Code 93 barcode
     */
    private void btncode93ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btncode93ActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>1D Barcode Code 93<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x62, 0x37})); // ESC b 7 (7 is code 93)

            int n2int = cb1DBarcodeOption.getSelectedIndex() + 1;
            list.addAll(Arrays.asList(new Byte[]{(byte) n2int})); //Under-bar and line feed options

            //Find out what size of module was selected
            if (rb1code93.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x31}));
            } else if (rb2code93.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x32}));
            } else if (rb3code93.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x33}));
            }

            //Get height of barcode
            String n4 = numcode93.getValue() + "";
            list.addAll(Arrays.asList(Byte.valueOf(n4)));

            //Barcode data
            String bcData = txtcode93.getText();
            byte[] byteArray = bcData.getBytes("UTF-8");
            for (int index = 0; index < bcData.length(); index++) {
                list.addAll(Arrays.asList(byteArray[index]));
            }

            list.addAll(Arrays.asList(new Byte[]{0x1E}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } catch (UnsupportedEncodingException exp) {
            status += "Failure<br />UnsupportedEncodingException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btncode93ActionPerformed

    /*
     * Code 128 barcode
     */
    private void btncode128ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btncode128ActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>1D Barcode Code 128<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x62, 0x36})); // ESC b 6 (6 is code 128)

            int n2int = cb1DBarcodeOption.getSelectedIndex() + 1;
            list.addAll(Arrays.asList(new Byte[]{(byte) n2int})); //Under-bar and line feed options

            //Find out what size of module was selected
            if (rb1code128.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x31}));
            } else if (rb2code128.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x32}));
            } else if (rb3code128.isSelected()) {
                list.addAll(Arrays.asList(new Byte[]{0x33}));
            }

            //Get height of barcode
            String n4 = numcode128.getValue() + "";
            list.addAll(Arrays.asList(Byte.valueOf(n4)));

            //Barcode data
            String bcData = txtcode128.getText();
            byte[] byteArray = bcData.getBytes("UTF-8");
            for (int index = 0; index < bcData.length(); index++) {
                list.addAll(Arrays.asList(byteArray[index]));
            }

            list.addAll(Arrays.asList(new Byte[]{0x1E}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } catch (UnsupportedEncodingException exp) {
            status += "Failure<br />UnsupportedEncodingException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btncode128ActionPerformed

    /*
     * QR MODEL SET
     */
    private void btnQRmodelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQRmodelActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>QR - Set Model - Step 1<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x79, 0x53, 0x30})); 

            int model = cbQRmodel.getSelectedIndex() + 1;
            list.addAll(Arrays.asList(new Byte[]{(byte) model}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnQRmodelActionPerformed

    /*
     * QR ECC Set
     */
    private void btnQReccActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQReccActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>QR - Set Correction Level - Step 2<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x79, 0x53, 0x31}));

            int ecc = cbQRecc.getSelectedIndex() + 1;
            list.addAll(Arrays.asList(new Byte[]{(byte) ecc}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnQReccActionPerformed

    /*
     * QR set cell size
     */
    private void btnQRcellsizeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQRcellsizeActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>QR - Set Cell Size - Step 3<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x79, 0x53, 0x32}));

            String cellSize = numQRcellsize.getValue() + "";
            list.addAll(Arrays.asList(Byte.valueOf(cellSize)));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnQRcellsizeActionPerformed

    /*
     * QR Data set
     */
    private void btnQRdataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQRdataActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>QR - Set Data - Step 4<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x79, 0x44, 0x31, 0x00}));

            String QRdata = txtQRdata.getText() + "";
            byte[] byteArray = QRdata.getBytes("UTF-8");
            int strLen = QRdata.length();
            list.addAll(Arrays.asList(new Byte[]{(byte) strLen}));
            list.addAll(Arrays.asList(new Byte[]{0x00}));

            for (int index = 0; index < QRdata.length(); index++) {
                list.addAll(Arrays.asList(byteArray[index]));
            }

            list.addAll(Arrays.asList(new Byte[]{0x0A}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } catch (UnsupportedEncodingException exp) {
            status += "Failure<br />UnsupportedEncodingException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnQRdataActionPerformed

    /*
     * QR print command
     */
    private void btnQRprintActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQRprintActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>QR - Print - Step 5<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x79, 0x50}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnQRprintActionPerformed

    /*
     * QR code do all
     */
    private void btnQRallActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQRallActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>QR - Set All and Print<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            //STEP 1
            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x79, 0x53, 0x30}));
            int model = cbQRmodel.getSelectedIndex() + 1;
            list.addAll(Arrays.asList(new Byte[]{(byte) model}));

            //STEP 2
            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x79, 0x53, 0x31}));
            int ecc = cbQRecc.getSelectedIndex() + 1;
            list.addAll(Arrays.asList(new Byte[]{(byte) ecc}));

            //STEP 3
            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x79, 0x53, 0x32}));
            String cellSize = numQRcellsize.getValue() + "";
            list.addAll(Arrays.asList(Byte.valueOf(cellSize)));

            //STEP 4
            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x79, 0x44, 0x31, 0x00}));
            String QRdata = txtQRdata.getText() + "";
            byte[] byteArray = QRdata.getBytes("UTF-8");
            int strLen = QRdata.length();
            list.addAll(Arrays.asList(new Byte[]{(byte) strLen}));
            list.addAll(Arrays.asList(new Byte[]{0x00}));
            for (int index = 0; index < QRdata.length(); index++) {
                list.addAll(Arrays.asList(byteArray[index]));
            }
            list.addAll(Arrays.asList(new Byte[]{0x0A}));

            //STEP 5
            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x79, 0x50}));//print

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        }catch (UnsupportedEncodingException exp) {
            status += "Failure<br />UnsupportedEncodingException<br />";
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnQRallActionPerformed

    /*
     * PDF data set
     */
    private void btnPDFdataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPDFdataActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>PDF417 - Set Data<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            //STEP 4
            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x78, 0x44}));
            String PDFdata = txtPDFdata.getText() + "";
            byte[] byteArray = PDFdata.getBytes("UTF-8");
            int strLen = PDFdata.length();
            list.addAll(Arrays.asList(new Byte[]{(byte) strLen}));
            list.addAll(Arrays.asList(new Byte[]{0x00}));
            for (int index = 0; index < PDFdata.length(); index++) {
                list.addAll(Arrays.asList(byteArray[index]));
            }
            list.addAll(Arrays.asList(new Byte[]{0x0A}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        }catch (UnsupportedEncodingException exp) {
            status += "Failure<br />UnsupportedEncodingException<br />";
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnPDFdataActionPerformed

    /*
     * PDF417 set size
     */
    private void btnPDFsizeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPDFsizeActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>PDF417 - Set Size<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            String height = numPDFh.getValue() + "";
            String width = numPDFw.getValue() + "";

            if(rbPDF2.isSelected())
            {
                list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x78, 0x53, 0x30, 0x01, Byte.valueOf(height), Byte.valueOf(width)}));
            }
            else
            {
                list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x78, 0x53, 0x30, 0x00, Byte.valueOf(height), Byte.valueOf(width)}));
            }

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnPDFsizeActionPerformed

    //FOR GUI ONLY - NOT STAR ADK RELATED
    private void rbPDF2StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_rbPDF2StateChanged
        if(rbPDF1.isSelected())
        {
            lblPDFh.setText("Height:");
            lblPDFw.setText("Width:");
        }
        else if(rbPDF2.isSelected())
        {
            lblPDFh.setText("Line:");
            lblPDFw.setText("Column:");
        }
    }//GEN-LAST:event_rbPDF2StateChanged

    private void btnPDFallActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPDFallActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>PDF417 - Set Size<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            //Set size
            String height = numPDFh.getValue() + "";
            String width = numPDFw.getValue() + "";
            if(rbPDF2.isSelected())
            {
                list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x78, 0x53, 0x30, 0x01, Byte.valueOf(height), Byte.valueOf(width)}));
            }
            else
            {
                list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x78, 0x53, 0x30, 0x00, Byte.valueOf(height), Byte.valueOf(width)}));
            }

            //Set ECC Command
            String ECC = numPDFecc.getValue() + "";
            list.addAll(Arrays.asList(new Byte[]{0x1B,0x1D,0x78,0x53,0x31,Byte.valueOf(ECC)}));

            //Set X Dim
            String xDIM = numPDFxdim.getValue() + "";
            list.addAll(Arrays.asList(new Byte[]{0x1B,0x1D,0x78,0x53,0x32,Byte.valueOf(xDIM)}));

            //Set Ratio
            String ratio = numPDFratio.getValue() + "";
            list.addAll(Arrays.asList(new Byte[]{0x1B,0x1D,0x78,0x53,0x33,Byte.valueOf(ratio)}));

            //Set Data
            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x78, 0x44}));
            String PDFdata = txtPDFdata.getText() + "";
            byte[] byteArray = PDFdata.getBytes("UTF-8");
            int strLen = PDFdata.length();
            list.addAll(Arrays.asList(new Byte[]{(byte) strLen}));
            list.addAll(Arrays.asList(new Byte[]{0x00}));
            for (int index = 0; index < PDFdata.length(); index++) {
                list.addAll(Arrays.asList(byteArray[index]));
            }
            //LF then Print cmd
            list.addAll(Arrays.asList(new Byte[]{0x0A,0x1B,0x1D,0x78,0x50}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (UnsupportedEncodingException exp) {
            status += "Failure<br />UnsupportedEncodingException<br />";
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnPDFallActionPerformed

    /*
     * Set ECC ratio
     */
    private void btnPDFeccActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPDFeccActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>PDF417 - Set ECC Level<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            String ECC = numPDFecc.getValue() + "";

            //Set ECC Command
            list.addAll(Arrays.asList(new Byte[]{0x1B,0x1D,0x78,0x53,0x31,Byte.valueOf(ECC)}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnPDFeccActionPerformed

    /*
     * Set x dim for PDF417
     */
    private void btnPDFxdimActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPDFxdimActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>PDF417 - Set X-Dim<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            String xDIM = numPDFxdim.getValue() + "";

            //Set ECC Command
            list.addAll(Arrays.asList(new Byte[]{0x1B,0x1D,0x78,0x53,0x32,Byte.valueOf(xDIM)}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnPDFxdimActionPerformed

    /*
     * Set ratio for PDF 417
     */
    private void btnPDFratioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPDFratioActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>PDF417 - Set Ratio<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            String ratio = numPDFratio.getValue() + "";

            //Set ECC Command
            list.addAll(Arrays.asList(new Byte[]{0x1B,0x1D,0x78,0x53,0x33,Byte.valueOf(ratio)}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnPDFratioActionPerformed

    /*
     * Code Pages
     */
    private void btnCodePageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCodePageActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Code Page<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            int codePageSelected = cbCodePage.getSelectedIndex();
            //Set code page command (without the selected code page)
            list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x74}));
            String codePageData = txtCodePage.getText() + "";

            Byte[] encodedByteArray = new Byte[codePageData.length()];
            //The switch statement below will check for which code page is selected
            
            switch(codePageSelected){
                case 0://Normal*
                        list.addAll(Arrays.asList(new Byte[]{0x00}));
                        byte[] bytearray0 = codePageData.getBytes("Cp437");
                        for(int i = 0; i < bytearray0.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray0[i]);
                        }
                        break;
                case 1://437 (USA, Std. Europe)
                        list.addAll(Arrays.asList(new Byte[]{0x01}));
                        byte[] bytearray1 = codePageData.getBytes("Cp437");
                        for(int i = 0; i < bytearray1.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray1[i]);
                        }
                        break;
                case 2://Katakana
                        list.addAll(Arrays.asList(new Byte[]{0x02}));
                        byte[] bytearray2 = codePageData.getBytes("Cp930");
                        for(int i = 0; i < bytearray2.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray2[i]);
                        }
                        break;
                case 3://437 (USA, Std. Europe)
                        list.addAll(Arrays.asList(new Byte[]{0x03}));
                        byte[] bytearray3 = codePageData.getBytes("Cp437");
                        for(int i = 0; i < bytearray3.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray3[i]);
                        }
                        break;
                case 4://858 (Multilingual)
                        list.addAll(Arrays.asList(new Byte[]{0x04}));
                        byte[] bytearray4 = codePageData.getBytes("Cp858");
                        for(int i = 0; i < bytearray4.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray4[i]);
                        }
                        break;
                case 5://852 (Latin-2)
                        list.addAll(Arrays.asList(new Byte[]{0x05}));
                        byte[] bytearray5 = codePageData.getBytes("Cp852");
                        for(int i = 0; i < bytearray5.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray5[i]);
                        }
                        break;
                case 6://860 (Portuguese)
                        list.addAll(Arrays.asList(new Byte[]{0x06}));
                        byte[] bytearray6 = codePageData.getBytes("Cp860");
                        for(int i = 0; i < bytearray6.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray6[i]);
                        }
                        break;
                case 7://861 (Icelandic)
                        list.addAll(Arrays.asList(new Byte[]{0x07}));
                        byte[] bytearray7 = codePageData.getBytes("Cp861");
                        for(int i = 0; i < bytearray7.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray7[i]);
                        }
                        break;
                case 8://863 (Canadian French)
                        list.addAll(Arrays.asList(new Byte[]{0x08}));
                        byte[] bytearray8 = codePageData.getBytes("Cp863");
                        for(int i = 0; i < bytearray8.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray8[i]);
                        }
                        break;
                case 9://865 (Nordic)
                        list.addAll(Arrays.asList(new Byte[]{0x09}));
                        byte[] bytearray9 = codePageData.getBytes("Cp865");
                        for(int i = 0; i < bytearray9.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray9[i]);
                        }
                        break;
                case 10://866 (Cyrillic Russian)
                        list.addAll(Arrays.asList(new Byte[]{0x0A}));
                        byte[] bytearray10 = codePageData.getBytes("Cp866");
                        for(int i = 0; i < bytearray10.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray10[i]);
                        }
                        break;
                case 11://855 (Cyrillic Bulgarian)
                        list.addAll(Arrays.asList(new Byte[]{0x0B}));
                        byte[] bytearray11 = codePageData.getBytes("Cp855");
                        for(int i = 0; i < bytearray11.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray11[i]);
                        }
                        break;
                case 12://857 (Turkey)
                        list.addAll(Arrays.asList(new Byte[]{0x0C}));
                        byte[] bytearray12 = codePageData.getBytes("Cp857");
                        for(int i = 0; i < bytearray12.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray12[i]);
                        }
                        break;
                case 13://862 (Israel (Hebrew) )
                        list.addAll(Arrays.asList(new Byte[]{0x0D}));
                        byte[] bytearray13 = codePageData.getBytes("Cp862");
                        for(int i = 0; i < bytearray13.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray13[i]);
                        }
                        break;
                case 14://864 (Arabic)
                        list.addAll(Arrays.asList(new Byte[]{0x0E}));
                        byte[] bytearray14 = codePageData.getBytes("Cp864");
                        for(int i = 0; i < bytearray14.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray14[i]);
                        }
                        break;
                case 15://737 (Greek)
                        list.addAll(Arrays.asList(new Byte[]{0x0F}));
                        byte[] bytearray15 = codePageData.getBytes("Cp737");
                        for(int i = 0; i < bytearray15.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray15[i]);
                        }
                        break;
                case 16://851 (Greek)
                    return;
                        //NOT SUPPORTED BY THE JAVA VM
                case 17://869 (Greek)
                        list.addAll(Arrays.asList(new Byte[]{0x11}));
                        byte[] bytearray16 = codePageData.getBytes("Cp869");
                        for(int i = 0; i < bytearray16.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray16[i]);
                        }
                        break;
                case 18://928 (Greek)
                    return;
                        //NOT SUPPORTED BY THE JAVA VM
                case 19://772 (Lithuanian)
                    return;
                        //NOT SUPPORTED BY THE JAVA VM
                case 20://774 (Lithuanian)
                case 21://874 (Thai)
                        list.addAll(Arrays.asList(new Byte[]{0x15}));
                        byte[] bytearray17 = codePageData.getBytes("Cp874");
                        for(int i = 0; i < bytearray17.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray17[i]);
                        }
                        break;
                case 22://1252 (Windows Latin-1)
                        list.addAll(Arrays.asList(new Byte[]{0x16}));
                        byte[] bytearray18 = codePageData.getBytes("Cp1252");
                        for(int i = 0; i < bytearray18.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray18[i]);
                        }
                        break;
                case 23://1250 (Windows Latin-2)
                        list.addAll(Arrays.asList(new Byte[]{0x17}));
                        byte[] bytearray19 = codePageData.getBytes("Cp1250");
                        for(int i = 0; i < bytearray19.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray19[i]);
                        }
                        break;
                case 24://1251 (Windows Cyrillic)
                        list.addAll(Arrays.asList(new Byte[]{0x18}));
                        byte[] bytearray20 = codePageData.getBytes("Cp1251");
                        for(int i = 0; i < bytearray20.length; i++)
                        {
                            encodedByteArray[i] = new Byte(bytearray20[i]);
                        }
                        break;
                case 25://3840 (IBM-Russian)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 26://3841 (Gost)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 27://3843 (Polish)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 28://3844 (CS2)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 29://3845 (Hungarian)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 30://3846 (Turkish)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 31://3847 (Brazil-ABNT)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 32://3848 (Brazil-ABICOMP)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 33://1001 (Arabic)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 34://2001 (Lithuanian-KBL)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 35://3001 (Estonian-1)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 36://3002 (Estonian-2)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 37://3011 (Latvian-1)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 38://3012 (Latvian-2)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 39://3021 (Bulgarian)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
                case 40://3041 (Maltese)
                    return;
                    //NOT SUPPORTED BY THE JAVA VM
            }
            list.addAll(Arrays.asList(new Byte[]{0x0A}));

            data = new byte[ list.size() + encodedByteArray.length];

            for (int index = 0; index < list.size(); index++) {
                data[index] = (Byte) list.get(index);
            }

            for (int index = 0; index < encodedByteArray.length; index++) {
                data[index + list.size()] = encodedByteArray[index];
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }

        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        }catch (UnsupportedEncodingException exp) {
            status += "Failure<br />UnsupportedEncodingException<br />";
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnCodePageActionPerformed

    /*
     * Set Font A
     */
    private void btnFontAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFontAActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Set printer font to Font A<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x1E,0x46,0x00}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnFontAActionPerformed

    /*
     * Set Font B
     */
    private void btnFontBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFontBActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Set printer font to Font B<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x1E,0x46,0x01}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);

    }//GEN-LAST:event_btnFontBActionPerformed

    /*
     * OCR Font Set
     */
    private void brnFontOCRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_brnFontOCRActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Set printer font to Font OCR-B<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x1E,0x46,0x10}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_brnFontOCRActionPerformed

    /*
     * Line Feed
     */
    private void btnLFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLFActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Line Feed<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x0A}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnLFActionPerformed

    /*
     * 4mm line feed
     */
    private void btnLF4mmActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLF4mmActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Set Line Feed 4mm<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x7A,0x01}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnLF4mmActionPerformed

    /*
     * Set line feed to 3mm
     */
    private void btnLF3mmActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLF3mmActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Set Line Feed 3mm<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x7A,0x00}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnLF3mmActionPerformed

    /*
     * multiline feed
     */
    private void btnMLFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMLFActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Multi Line Feed<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            String MLFcount = numMLF.getValue() + "";
            
            list.addAll(Arrays.asList(new Byte[]{0x1B,0x61,Byte.valueOf(MLFcount)}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnMLFActionPerformed

    /*
     * Line spacing set to 3mm
     */
    private void btnLS3mmActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLS3mmActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Set Line Spacing to 3mm<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x30}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnLS3mmActionPerformed

    /*
     * 4mm line spacing
     */
    private void btnL4mmActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnL4mmActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Feed 4mm Lines<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            String lineCount = numL4mm.getValue() + "";

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x4A,Byte.valueOf(lineCount)}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnL4mmActionPerformed

    /*
     * 8mm set
     */
    private void btnL8mmActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnL8mmActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Feed 8mm Lines<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            String lineCount = numL8mm.getValue() + "";

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x49,Byte.valueOf(lineCount)}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnL8mmActionPerformed

    /*
     * Form feed action
     */
    private void btnFFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFFActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Form Feed<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x0C}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnFFActionPerformed

    /*
     * Full cut (no feed)
     */
    private void btnFullCutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFullCutActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Full Cut<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x64,0x00}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnFullCutActionPerformed

    /*
     * Partial cut (no feed)
     */
    private void btnPartialCutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPartialCutActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Partial Cut<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x64,0x01}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnPartialCutActionPerformed

    /*
     * Feed then full cut
     */
    private void btnFeedFullCutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFeedFullCutActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Feed and Full Cut<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x64,0x02}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnFeedFullCutActionPerformed

    /*
     * Feed partial cut command
     */
    private void btnFeedPartialCutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFeedPartialCutActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Feed and Partial Cut<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x64,0x03}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnFeedPartialCutActionPerformed

    /*
     * A function to show how to do text formatting commands
     */
    private void btnPrintTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintTFActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Print Text Formatting<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();



            if(chkTFslashz.isSelected()){
                list.addAll(Arrays.asList(new Byte[]{0x1B,0x2f,0x01}));
            }
            else{
                list.addAll(Arrays.asList(new Byte[]{0x1B,0x2f,0x00}));
            }
            if(chkTFbold.isSelected()){
                list.addAll(Arrays.asList(new Byte[]{0x1B,0x45}));
            }
            else{
                list.addAll(Arrays.asList(new Byte[]{0x1B,0x46}));
            }
            if(chkTFinvert.isSelected()){
                list.addAll(Arrays.asList(new Byte[]{0x1B,0x34}));
            }
            else{
                list.addAll(Arrays.asList(new Byte[]{0x1B,0x35}));
            }
            if(chkTFunderline.isSelected()){
                list.addAll(Arrays.asList(new Byte[]{0x1B,0x2d,0x01}));
            }
            else{
                list.addAll(Arrays.asList(new Byte[]{0x1B,0x2d,0x00}));
            }
            if(chkTFupperline.isSelected()){
                list.addAll(Arrays.asList(new Byte[]{0x1B,0x5f,0x01}));
            }
            else{
                list.addAll(Arrays.asList(new Byte[]{0x1B,0x5f,0x00}));
            }
            if(chkTFupsidedown.isSelected()){
                list.addAll(Arrays.asList(new Byte[]{0x0f}));
            }
            else{
                list.addAll(Arrays.asList(new Byte[]{0x12}));
            }


            String height = numTFh.getValue() + "";

            String width = numTFw.getValue() + "";

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x68,Byte.valueOf(height)}));

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x57,Byte.valueOf(width)}));

            Byte[] tempList;

            data = "Text Formatting\r\n\r\nNote: All text formatting commands are all sent before text.\r\n".getBytes();
            tempList = new Byte[data.length];
            CopyArray(data, tempList);
            list.addAll(Arrays.asList(tempList));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnPrintTFActionPerformed

    /*
     * A command to set the left margin
     */
    private void btnLeftMarginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLeftMarginActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Left Margin<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            String leftMarginCount = numTFLM.getValue() + "";

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x6C,Byte.valueOf(leftMarginCount)}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnLeftMarginActionPerformed

    /*
     * Command to set the right margin on a POS printer
     */
    private void btnRightMarginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRightMarginActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Right Margin<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            String rightMarginCount = numTFRM.getValue() + "";

            list.addAll(Arrays.asList(new Byte[]{0x1B,0x6C,Byte.valueOf(rightMarginCount)}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnRightMarginActionPerformed

    /*
     * Alignment functions for left right and center
     */
    private void btnAlignmentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAlignmentActionPerformed

        StarIOPort port = null;
        String portName = txtPortName.getText();
        String portSettings = txtPortSettings.getText();
        String status = "<html>Alignment<br /><br />";

        try {
            port = StarIOPort.getPort(portName, portSettings, TIMEOUT);

            byte[] data;
            ArrayList<Byte> list = new ArrayList<Byte>();

            int selectedAlign = cbAlignment.getSelectedIndex();
            
            list.addAll(Arrays.asList(new Byte[]{0x1B,0x1D,0x61,(byte) selectedAlign}));

            data = new byte[list.size()];

            for (int index = 0; index < data.length; index++) {
                data[index] = (Byte) list.get(index);
            }

            //For GUI purposes to show you hex or ascii command sent
            logIt(data);

            int totalSizeCommunicated = WritePortHelper(port, data); // see below
            if (totalSizeCommunicated == data.length) {
                status += "Success<br />";
            } else {
                status += "Error<br />Could not write all data to the printer.<br />";
            }
        } catch (StarIOPortException e) {
            status += "Failure to communicate<br />";
            //  e.printStackTrace();
        } catch (NumberFormatException ex) {
            status += "Failure<br />NumberFormatException<br />";
        } finally {
            if (port != null) {
                StarIOPort.releasePort(port);
            }
        }
        status += "</html>";
        txtStatus.setText(status);
    }//GEN-LAST:event_btnAlignmentActionPerformed

    /*
     * If the navigated tabs changes, display a rich text file in the box on the right
     */
    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
    int tabSelected = jTabbedPane1.getSelectedIndex();
    helpBox.setText("");
            try {
                if(tabSelected == 0) {FileInputStream fi = new FileInputStream("documentation/help_port.rtf");rtf.read(fi, helpBox.getDocument(), 0);}
                else if (tabSelected == 1) {FileInputStream fi = new FileInputStream("documentation/help_1dbarcode.rtf");rtf.read(fi, helpBox.getDocument(), 0);}
                else if (tabSelected == 2) {FileInputStream fi = new FileInputStream("documentation/help_2dbarcode.rtf");rtf.read(fi, helpBox.getDocument(), 0);}
                else if (tabSelected == 3) {FileInputStream fi = new FileInputStream("documentation/help_codepage.rtf");rtf.read(fi, helpBox.getDocument(), 0);}
                else if (tabSelected == 4) {FileInputStream fi = new FileInputStream("documentation/help_font.rtf");rtf.read(fi, helpBox.getDocument(), 0);}
                else if (tabSelected == 5) {FileInputStream fi = new FileInputStream("documentation/help_feed.rtf");rtf.read(fi, helpBox.getDocument(), 0);}
                else if (tabSelected == 6) {FileInputStream fi = new FileInputStream("documentation/help_cut.rtf");rtf.read(fi, helpBox.getDocument(), 0);}
                else if (tabSelected == 7) {FileInputStream fi = new FileInputStream("documentation/help_text.rtf");rtf.read(fi, helpBox.getDocument(), 0);}

        } catch (FileNotFoundException e) {
          System.out.println("Documentation files not found!");
        } catch (IOException e) {
          System.out.println("I/O error");
        } catch (BadLocationException e) {
        }
    }//GEN-LAST:event_jTabbedPane1StateChanged

    /*
     * A port helper function to send data to the printer and receive how many bytes were sent successfully
     */
    private static int WritePortHelper(StarIOPort port, byte[] writeBuffer) throws StarIOPortException {
        int zeroProgressOccurances = 0;
        int totalSizeCommunicated = 0;

        while ((totalSizeCommunicated < writeBuffer.length) && (zeroProgressOccurances < 2)) // adjust zeroProgressOccurances as needed
        {
            int sizeCommunicated = port.writePort(writeBuffer, totalSizeCommunicated, writeBuffer.length - totalSizeCommunicated);
            if (sizeCommunicated == 0) {
                zeroProgressOccurances++;
            } else {
                totalSizeCommunicated += sizeCommunicated;
                zeroProgressOccurances = 0;
            }
        }

        return totalSizeCommunicated;
    }

    /*
     * Helper function to cupy one byte array to another different class of byte array
     */
    private static void CopyArray(byte[] array1, Byte[] array2) {
        for (int index = 0; index < array2.length; index++) {
            array2[index] = array1[index];
        }
    }

    //Anything after this line is just for GUI reasons only, no useful ADK stuff is below


    /*
     * A function to turn the sent bytes into readable ascii or hex on a log box located at the bottom of the ADK.
     */
    public void logIt(byte[] raw) {
        if (rbhex.isSelected()) {
            String HEXES = "0123456789ABCDEF";
            if (raw == null) {
                return;
            }
            final StringBuilder hex = new StringBuilder(2 * raw.length);
            for (final byte b : raw) {
                hex.append(HEXES.charAt((b & 0xF0) >> 4)).append(HEXES.charAt((b & 0x0F)));
                hex.append(" ");
            }
            txtLog.setText(hex.toString());
        } else if (rbascii.isSelected()) {
            if (raw == null) {
                return;
            }
            final StringBuilder ascii = new StringBuilder(raw.length);
            for (final byte b : raw) {
                switch (b) {
                    case 0x00:
                        ascii.append("NUL");
                        break;
                    case 0x01:
                        ascii.append("SOH");
                        break;
                    case 0x02:
                        ascii.append("STX");
                        break;
                    case 0x03:
                        ascii.append("ETX");
                        break;
                    case 0x04:
                        ascii.append("EOT");
                        break;
                    case 0x05:
                        ascii.append("ENQ");
                        break;
                    case 0x06:
                        ascii.append("ACK");
                        break;
                    case 0x07:
                        ascii.append("BEL");
                        break;
                    case 0x08:
                        ascii.append("BS");
                        break;
                    case 0x09:
                        ascii.append("TAB");
                        break;
                    case 0x0A:
                        ascii.append("LF");
                        break;
                    case 0x0B:
                        ascii.append("VT");
                        break;
                    case 0x0C:
                        ascii.append("FF");
                        break;
                    case 0x0D:
                        ascii.append("CR");
                        break;
                    case 0x0E:
                        ascii.append("SO");
                        break;
                    case 0x0F:
                        ascii.append("SI");
                        break;
                    case 0x10:
                        ascii.append("DLE");
                        break;
                    case 0x11:
                        ascii.append("DC1");
                        break;
                    case 0x12:
                        ascii.append("DC2");
                        break;
                    case 0x13:
                        ascii.append("DC3");
                        break;
                    case 0x14:
                        ascii.append("DC4");
                        break;
                    case 0x15:
                        ascii.append("NAK");
                        break;
                    case 0x16:
                        ascii.append("SYN");
                        break;
                    case 0x17:
                        ascii.append("ETB");
                        break;
                    case 0x18:
                        ascii.append("CAN");
                        break;
                    case 0x19:
                        ascii.append("EM");
                        break;
                    case 0x1A:
                        ascii.append("SUB");
                        break;
                    case 0x1B:
                        ascii.append("ESC");
                        break;
                    case 0x1C:
                        ascii.append("FS");
                        break;
                    case 0x1D:
                        ascii.append("GS");
                        break;
                    case 0x1E:
                        ascii.append("RS");
                        break;
                    case 0x1F:
                        ascii.append("US");
                        break;
                    case 0x20:
                        ascii.append(" ");
                        break;
                    case 0x21:
                        ascii.append("!");
                        break;
                    case 0x22:
                        ascii.append("\"");
                        break;
                    case 0x23:
                        ascii.append("#");
                        break;
                    case 0x24:
                        ascii.append("$");
                        break;
                    case 0x25:
                        ascii.append("%");
                        break;
                    case 0x26:
                        ascii.append("&");
                        break;
                    case 0x27:
                        ascii.append("'");
                        break;
                    case 0x28:
                        ascii.append("(");
                        break;
                    case 0x29:
                        ascii.append(")");
                        break;
                    case 0x2A:
                        ascii.append("*");
                        break;
                    case 0x2B:
                        ascii.append("+");
                        break;
                    case 0x2C:
                        ascii.append(",");
                        break;
                    case 0x2D:
                        ascii.append("-");
                        break;
                    case 0x2E:
                        ascii.append(".");
                        break;
                    case 0x2F:
                        ascii.append("/");
                        break;
                    case 0x30:
                        ascii.append("0");
                        break;
                    case 0x31:
                        ascii.append("1");
                        break;
                    case 0x32:
                        ascii.append("2");
                        break;
                    case 0x33:
                        ascii.append("3");
                        break;
                    case 0x34:
                        ascii.append("4");
                        break;
                    case 0x35:
                        ascii.append("5");
                        break;
                    case 0x36:
                        ascii.append("6");
                        break;
                    case 0x37:
                        ascii.append("7");
                        break;
                    case 0x38:
                        ascii.append("8");
                        break;
                    case 0x39:
                        ascii.append("9");
                        break;
                    case 0x3A:
                        ascii.append(":");
                        break;
                    case 0x3B:
                        ascii.append(";");
                        break;
                    case 0x3C:
                        ascii.append("<");
                        break;
                    case 0x3D:
                        ascii.append("=");
                        break;
                    case 0x3E:
                        ascii.append(">");
                        break;
                    case 0x3F:
                        ascii.append("?");
                        break;
                    case 0x40:
                        ascii.append("@");
                        break;
                    case 0x41:
                        ascii.append("A");
                        break;
                    case 0x42:
                        ascii.append("B");
                        break;
                    case 0x43:
                        ascii.append("C");
                        break;
                    case 0x44:
                        ascii.append("D");
                        break;
                    case 0x45:
                        ascii.append("E");
                        break;
                    case 0x46:
                        ascii.append("F");
                        break;
                    case 0x47:
                        ascii.append("G");
                        break;
                    case 0x48:
                        ascii.append("H");
                        break;
                    case 0x49:
                        ascii.append("I");
                        break;
                    case 0x4A:
                        ascii.append("J");
                        break;
                    case 0x4B:
                        ascii.append("K");
                        break;
                    case 0x4C:
                        ascii.append("L");
                        break;
                    case 0x4D:
                        ascii.append("M");
                        break;
                    case 0x4E:
                        ascii.append("N");
                        break;
                    case 0x4F:
                        ascii.append("O");
                        break;
                    case 0x50:
                        ascii.append("P");
                        break;
                    case 0x51:
                        ascii.append("Q");
                        break;
                    case 0x52:
                        ascii.append("R");
                        break;
                    case 0x53:
                        ascii.append("S");
                        break;
                    case 0x54:
                        ascii.append("T");
                        break;
                    case 0x55:
                        ascii.append("U");
                        break;
                    case 0x56:
                        ascii.append("V");
                        break;
                    case 0x57:
                        ascii.append("W");
                        break;
                    case 0x58:
                        ascii.append("X");
                        break;
                    case 0x59:
                        ascii.append("Y");
                        break;
                    case 0x5A:
                        ascii.append("Z");
                        break;
                    case 0x5B:
                        ascii.append("[");
                        break;
                    case 0x5C:
                        ascii.append("\\");
                        break;
                    case 0x5D:
                        ascii.append("]");
                        break;
                    case 0x5E:
                        ascii.append("^");
                        break;
                    case 0x5F:
                        ascii.append("_");
                        break;
                    case 0x60:
                        ascii.append("`");
                        break;
                    case 0x61:
                        ascii.append("a");
                        break;
                    case 0x62:
                        ascii.append("b");
                        break;
                    case 0x63:
                        ascii.append("c");
                        break;
                    case 0x64:
                        ascii.append("d");
                        break;
                    case 0x65:
                        ascii.append("e");
                        break;
                    case 0x66:
                        ascii.append("f");
                        break;
                    case 0x67:
                        ascii.append("g");
                        break;
                    case 0x68:
                        ascii.append("h");
                        break;
                    case 0x69:
                        ascii.append("i");
                        break;
                    case 0x6A:
                        ascii.append("j");
                        break;
                    case 0x6B:
                        ascii.append("k");
                        break;
                    case 0x6C:
                        ascii.append("l");
                        break;
                    case 0x6D:
                        ascii.append("m");
                        break;
                    case 0x6E:
                        ascii.append("n");
                        break;
                    case 0x6F:
                        ascii.append("o");
                        break;
                    case 0x70:
                        ascii.append("p");
                        break;
                    case 0x71:
                        ascii.append("q");
                        break;
                    case 0x72:
                        ascii.append("r");
                        break;
                    case 0x73:
                        ascii.append("s");
                        break;
                    case 0x74:
                        ascii.append("t");
                        break;
                    case 0x75:
                        ascii.append("u");
                        break;
                    case 0x76:
                        ascii.append("v");
                        break;
                    case 0x77:
                        ascii.append("w");
                        break;
                    case 0x78:
                        ascii.append("x");
                        break;
                    case 0x79:
                        ascii.append("y");
                        break;
                    case 0x7A:
                        ascii.append("z");
                        break;
                    case 0x7B:
                        ascii.append("{");
                        break;
                    case 0x7C:
                        ascii.append("|");
                        break;
                    case 0x7D:
                        ascii.append("}");
                        break;
                    case 0x7E:
                        ascii.append("~");
                        break;
                    case 0x7F:
                        ascii.append(" ");
                        break;
                    default:
                        ascii.append("");
                        break;
                }

                ascii.append(" ");
            }
            txtLog.setText(ascii.toString());
        }
    }

    /** Returns an ImageIcon, or null if the path was invalid. */
    protected ImageIcon createImageIcon(String path, String description) {
        java.net.URL imgURL = getClass().getResource(path);
        if (imgURL != null) {
            return new ImageIcon(imgURL, description);
        } else {
            System.err.println("Couldn't find file: " + path);
            return null;
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new TestStarIO().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton brnFontOCR;
    private javax.swing.JButton btnAlignment;
    private javax.swing.JButton btnCheckBlock;
    private javax.swing.JButton btnCode39;
    private javax.swing.JButton btnCodePage;
    private javax.swing.JButton btnFF;
    private javax.swing.JButton btnFeedFullCut;
    private javax.swing.JButton btnFeedPartialCut;
    private javax.swing.JButton btnFontA;
    private javax.swing.JButton btnFontB;
    private javax.swing.JButton btnFullCut;
    private javax.swing.JButton btnL4mm;
    private javax.swing.JButton btnL8mm;
    private javax.swing.JButton btnLF;
    private javax.swing.JButton btnLF3mm;
    private javax.swing.JButton btnLF4mm;
    private javax.swing.JButton btnLS3mm;
    private javax.swing.JButton btnLeftMargin;
    private javax.swing.JButton btnMLF;
    private javax.swing.JButton btnMonitoring;
    private javax.swing.JButton btnOpenCashD;
    private javax.swing.JButton btnPDFall;
    private javax.swing.JButton btnPDFdata;
    private javax.swing.JButton btnPDFecc;
    private javax.swing.JButton btnPDFratio;
    private javax.swing.JButton btnPDFsize;
    private javax.swing.JButton btnPDFxdim;
    private javax.swing.JButton btnPartialCut;
    private javax.swing.JButton btnPrintSampleR;
    private javax.swing.JButton btnPrintTF;
    private javax.swing.JButton btnQRall;
    private javax.swing.JButton btnQRcellsize;
    private javax.swing.JButton btnQRdata;
    private javax.swing.JButton btnQRecc;
    private javax.swing.JButton btnQRmodel;
    private javax.swing.JButton btnQRprint;
    private javax.swing.JButton btnRightMargin;
    private javax.swing.JButton btncode128;
    private javax.swing.JButton btncode93;
    private javax.swing.JButton btni2of5;
    @SuppressWarnings("rawtypes")
	private javax.swing.JComboBox cb1DBarcodeOption;
    @SuppressWarnings("rawtypes")
	private javax.swing.JComboBox cbAlignment;
    @SuppressWarnings("rawtypes")
	private javax.swing.JComboBox cbCodePage;
    @SuppressWarnings("rawtypes")
	private javax.swing.JComboBox cbQRecc;
    @SuppressWarnings("rawtypes")
	private javax.swing.JComboBox cbQRmodel;
    private javax.swing.JCheckBox chkTFbold;
    private javax.swing.JCheckBox chkTFinvert;
    private javax.swing.JCheckBox chkTFslashz;
    private javax.swing.JCheckBox chkTFunderline;
    private javax.swing.JCheckBox chkTFupperline;
    private javax.swing.JCheckBox chkTFupsidedown;
    private javax.swing.JLabel code128;
    private javax.swing.JLabel code39;
    private javax.swing.JLabel code93;
    private javax.swing.ButtonGroup grpcode128;
    private javax.swing.ButtonGroup grpcode39;
    private javax.swing.ButtonGroup grpcode93;
    private javax.swing.ButtonGroup grpi25;
    private javax.swing.ButtonGroup grppdf417;
    private javax.swing.JEditorPane helpBox;
    private javax.swing.JLabel i2of5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel22;
    private javax.swing.JPanel jPanel23;
    private javax.swing.JPanel jPanel24;
    private javax.swing.JPanel jPanel25;
    private javax.swing.JPanel jPanel26;
    private javax.swing.JPanel jPanel27;
    private javax.swing.JPanel jPanel28;
    private javax.swing.JPanel jPanel29;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel30;
    private javax.swing.JPanel jPanel31;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTabbedPane jTabbedPane3;
    private javax.swing.JLabel lblPDFh;
    private javax.swing.JLabel lblPDFh1;
    private javax.swing.JLabel lblPDFw;
    private javax.swing.ButtonGroup logRadioGrp;
    private javax.swing.JMenuItem miExit;
    private javax.swing.JSpinner numL4mm;
    private javax.swing.JSpinner numL8mm;
    private javax.swing.JSpinner numMLF;
    private javax.swing.JSpinner numPDFecc;
    private javax.swing.JSpinner numPDFh;
    private javax.swing.JSpinner numPDFratio;
    private javax.swing.JSpinner numPDFw;
    private javax.swing.JSpinner numPDFxdim;
    private javax.swing.JSpinner numQRcellsize;
    private javax.swing.JSpinner numTFLM;
    private javax.swing.JSpinner numTFRM;
    private javax.swing.JSpinner numTFh;
    private javax.swing.JSpinner numTFw;
    private javax.swing.JSpinner numcode128;
    private javax.swing.JSpinner numcode39;
    private javax.swing.JSpinner numcode93;
    private javax.swing.JSpinner numi2of5;
    private javax.swing.JLabel qrcodes;
    private javax.swing.JRadioButton rb1code128;
    private javax.swing.JRadioButton rb1code39;
    private javax.swing.JRadioButton rb1code93;
    private javax.swing.JRadioButton rb1i2of5;
    private javax.swing.JRadioButton rb2code128;
    private javax.swing.JRadioButton rb2code39;
    private javax.swing.JRadioButton rb2code93;
    private javax.swing.JRadioButton rb2i2of5;
    private javax.swing.JRadioButton rb3code128;
    private javax.swing.JRadioButton rb3code39;
    private javax.swing.JRadioButton rb3code93;
    private javax.swing.JRadioButton rb3i2of5;
    private javax.swing.JRadioButton rb4code39;
    private javax.swing.JRadioButton rb4i2of5;
    private javax.swing.JRadioButton rb5code39;
    private javax.swing.JRadioButton rb5i2of5;
    private javax.swing.JRadioButton rb6code39;
    private javax.swing.JRadioButton rb6i2of5;
    private javax.swing.JRadioButton rb7code39;
    private javax.swing.JRadioButton rb7i2of5;
    private javax.swing.JRadioButton rb8code39;
    private javax.swing.JRadioButton rb8i2of5;
    private javax.swing.JRadioButton rb9code39;
    private javax.swing.JRadioButton rb9i2of5;
    private javax.swing.JRadioButton rbPDF1;
    private javax.swing.JRadioButton rbPDF2;
    private javax.swing.JRadioButton rbascii;
    private javax.swing.JRadioButton rbhex;
    private javax.swing.JLabel starLogo;
    private javax.swing.JTextField txtCodePage;
    private javax.swing.JTextArea txtLog;
    private javax.swing.JTextField txtPDFdata;
    private javax.swing.JTextField txtPortName;
    private javax.swing.JTextField txtPortSettings;
    private javax.swing.JTextField txtQRdata;
    private javax.swing.JLabel txtStatus;
    private javax.swing.JTextField txtcode128;
    private javax.swing.JTextField txtcode39data;
    private javax.swing.JTextField txtcode93;
    private javax.swing.JTextField txti2of5data;
    // End of variables declaration//GEN-END:variables
}
